String.prototype.splice = function(start, newStr) {
    return this.slice(0, start) + newStr + this.slice(start);
};



newName="108+686横向裂缝重079m2"
if(newName.trim().substr(0, 1) == "K" || newName.trim().substr(0, 1) == "k"){
    //满足以K开头

    if(newName.trim().substr(0, 2) == "K0" || newName.trim().substr(0, 2) == "k0"){
        //满足以K0开头

    }else{
        newName=newName.trim().splice(1, "0");
    }
   
    
}
else{
    if(newName.trim().substr(0, 1) == "0"){
        newName="K"+newName.trim()
    }else{
        newName="K0"+newName.trim()
    }

}

// str=str.trim().splice(1, "0");
console.log(newName)